﻿using huqiang;
using huqiang.Core.HGUI;
using huqiang.Data;
using huqiang.UIModel;
using UnityEngine;

public class UIStartScript : MonoBehaviour
{
    public HGUIRender GUIRender;
#if UNITY_STANDALONE
    static string platfrom = "win";
#elif UNITY_IPHONE
    static string platfrom = "ios";
#elif UNITY_ANDROID
    static string platfrom = "and";
#endif
    public static UIStartScript Instance;
    public TextAsset baseUI;
    //public string RemoteIP="192.168.0.134";
    //public int RemotePort = 8899;
    public bool HotFix;
    protected void Start()
    {
        Setting.LoadSetting();
        Instance = this;
        App.Initial(GUIRender.canvas);
        DontDestroyOnLoad(GUIRender.gameObject);
        DontDestroyOnLoad(gameObject);
        HGUIManager.LoadModels(baseUI.bytes, "baseUI");
#if UNITY_EDITOR
        AssetBundle.UnloadAllAssetBundles(true);
#endif
        //ElementAsset.LoadAssetsAsync(Application.streamingAssetsPath + "/base.unity3d").PlayOver = (o, e) =>
        //{
            UIPage.LoadPage<LoadingPage>().Cmd("checkVersion", HotFix);
        //};
    }
    private void OnApplicationQuit()
    {
        App.Dispose();
    }
}
